import { defineComponent } from 'vue';
import { ToThousandsTOOL } from '@/utils';
import { IndustryRankMap } from '@config/map';

export default defineComponent({
  name: 'CompanyCnt',
  props: {
    name: String,
    data: String || Number,
  },
  render(props) {
    const iconPath = IndustryRankMap.find((i) => i.name === props.name)?.icon;
    return (
      <div id="CompanyCnt">
        <img src={require(`@assets/${iconPath}`)} />
        <header>{props.name}企业数</header>
        <aside>
          {ToThousandsTOOL(props.data)}
          <span> 家</span>
        </aside>
      </div>
    );
  },
});
